package com.neusoft.bizcore.web.dto.result;

import java.io.Serializable;

import io.swagger.annotations.ApiModelProperty;

/**
 * error result
 *
 * @author sunchf
 * @date 2018年12月10日 上午9:26:51
 */
public class ResultError implements Serializable {

    private static final long serialVersionUID = 8042733799291115991L;

    /**
     * the filed name that emitted errors
     */
    @ApiModelProperty(value = "the field name, validation error", position = 0)
    private String field;

    /**
     * the actual error message
     */
    @ApiModelProperty(value = "the actual error message", position = 1)
    private String errmsg;

    public ResultError() {
    }

    public ResultError(final String errmsg, final String field) {
        this.field = field;
        this.errmsg = errmsg;
    }

    public String getField() {
        return this.field;
    }

    public String getErrmsg() {
        return this.errmsg;
    }

    public void setField(final String field) {
        this.field = field;
    }

    public void setErrmsg(final String errmsg) {
        this.errmsg = errmsg;
    }

    @Override
    public String toString() {
        return String.format("{errmsg:%s, field:%s}", this.errmsg, this.field);
    }
}
